<?php

/**
 * winbinder 패키지 
 * 
 * 
 * @package php.ui.winbinder
 */

/**
 * WBPushButton
 *
 * @package php.ui.winbinder
 */ 
class WBPushButton extends WBControl { 
	public function __construct($options = array()) { 
		$options['class'] = PushButton;

		parent::__construct($options);
	}

	public function initComponent() { 
		parent::initComponent();

		if (isset($this->tooltip)) $this->setToolTip($this->getOption('tooltip'));
	}

	/**
	 * 툴팁 설정
	 * 
	 * @param string $tooltip
	 */
	public function setToolTip($tooltip) { 
		$this->setText(array(null, $tooltip));
	}

	/**
	 * 기본 크기 지정하기 
	 * 
	 * @see WBComponent#getPreferedSize()
	 */
	public function getPreferedSize() { 
		$arr = wb_get_size($this->getText());

		return array(
			'width' => $arr[0] + 14,
			'height' => $arr[1] + 10,
		);
	}
}

?>